package com.neuedu.mapper;

import com.neuedu.domain.OrderItem;
import com.neuedu.domain.Orders;
import com.neuedu.domain.Products;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ercai
 * @date 2019/8/5 - 18:29
 */
@Repository
public interface WebOrdersMapper {
    /**
     * 通过id查找书籍
     * @param id
     * @return
     */
    Products findBook(Integer id);
    /**
     * 生成订单
     */
    void addOrder(Orders order);
    /**
     * 生成订单详情
     */
    void addOrderItem(@Param("orderItems") List<OrderItem> orderItems);
    /**
     * 减库存
     */
    void deletePnum(@Param("orderItems") List<OrderItem> orderItems);
    /**
     * 通过id查找订单
     */
    List<Orders> findOrderById(Integer id);
    /**
     * 通过orderId查询订单详情
     */
    Orders findOrderByOrderId(String id);
}
